package xinxin.com.ChainofResponsibilityPattern.Manager;

import xinxin.com.ChainofResponsibilityPattern.Request.Request;

/**
 * @author ：史鑫鑫
 * @date ：Created in 2019/4/1 20:36
 */
public class GeneralManager extends Manager {
    public GeneralManager(String name) {
        super(name);
    }

    @Override
    public void RequestApplicatuions(Request request) {
        if (request.getRequestType().equals("请假")) {
            System.out.println(name + ":" + request.getRequestContent() + " 数量" + request.getNumber() + " 被批准");
        } else if (request.getRequestType().equals("加薪") && request.getNumber() <= 500) {
            System.out.println(name + ":" + request.getRequestContent() + " 数量" + request.getNumber() + " 被批准");
        } else if (request.getRequestType()=="加薪" && request.getNumber() > 500) {
            System.out.println(name + ":" + request.getRequestContent() + " 数量" + request.getNumber() + " 再说吧");
        }
    }
}
